✨ Add configurable browser type for static-site and storybook#197
✨ Add configurable browser type for static-site and storybook#197
Conversation
- Add `browser.type` config option (chromium, firefox, webkit) - Add `--browser <type>` CLI flag - Improve error messages when browsers aren't installed - Include helpful CI setup instructions in error output Users now control browser installation in CI, enabling caching and version control. Default remains chromium for compatibility.
Vizzly - Visual Test ResultsCLI Reporter - 6 changes need review
Changes needing review (6)filter-failed-only · Firefox · 375×667 · 14.2% diff search-homepage · Firefox · 375×696 · 2.0% diff fullscreen-viewer · Firefox · 375×667 · 195.5% diff bulk-accept-dialog · Firefox · 375×667 · 1.9% diff filter-failed-only · Firefox · 1920×1080 · 0.1% diff bulk-accept-dialog · Firefox · 1920×1080 · 10.5% diff CLI TUI - 1 change needs review
|
Code ReviewThis is a solid PR that adds browser configurability with good error handling. Here's my detailed feedback: ✅ Strengths
🔍 Issues & Suggestions1. Missing Unit Tests for Browser Launching (Medium Priority)The new error handling and browser type selection logic in Recommendation: Add unit tests for
Example test location: 2. Fragile Error Detection (Medium Priority)if (
error.message.includes("Executable doesn't exist") ||
error.message.includes('browserType.launch')
) {This string matching is brittle. If Playwright changes their error messages in the future, users will get unhelpful errors instead of your nice installation message. Recommendation:
3. Code Duplication (Low Priority)The Recommendation: Consider extracting to a shared package (e.g., 4. Missing Test for CLI Option (Low Priority)While Recommendation: Add a test that verifies: // clients/static-site/tests/cli-options.test.js or similar
it('--browser flag passes through to launchBrowser', async () => {
// Test that CLI flag reaches the browser launcher with correct type
});5. Browser Type Validation Timing (Low Priority)Browser type is validated in two places:
The storybook client lacks the Zod validation in config-schema. This inconsistency means invalid browser types fail at different times. Recommendation: Either add browser schema validation to storybook's config-schema or remove it from static-site for consistency. Failing early (at config load) is better UX. 📊 Test Coverage GapBased on the diff, I don't see tests for:
These are critical paths that should have test coverage. 🎯 Security & PerformanceNo security concerns identified. The browser type is validated before use, preventing injection attacks. Performance impact is neutral - the changes don't add overhead. 📝 Minor Nitpicks
🎬 RecommendationThis PR is functionally sound and ready to merge with the current test coverage, but I'd recommend adding unit tests for The excellent error messaging and backward-compatible defaults make this a great UX improvement despite the minor gaps above. Suggested next steps:
|







Summary
browser.typeconfig option supportingchromium,firefox, andwebkit--browser <type>CLI flag for bothvizzly static-siteandvizzly storybookMotivation
When running in CI, users were getting a confusing Playwright error when browsers weren't installed. Now they get a clear message with exactly what command to run:
This also gives users control over:
Usage
Config file:
CLI:
Test plan